package com.kznnc.data_structure.current;

import com.kznnc.data_structure.entity.User;

import static java.lang.Thread.currentThread;

/**
 * @Description  中断使用
 * @Author houchenkai
 * @Created Date: 2021/7/2 11:01
 * @ClassName
 */
@SuppressWarnings("all")
public class InterruptDemo1 {


    private static  User user = new User("1",1);

    public static void main(String[] args) {


        Thread main = currentThread();
       // main.interrupt(); //设置中断
       // System.out.println(main.isInterrupted()); // 设置中断后 中断状态为true
        System.out.println(main.interrupted());// 获取中断状态并返回  如果设置了中断则就
        System.out.println(main.isInterrupted());
    }







}
